package com.systop.party05.base;

import android.app.Application;

import com.systop.party05.utils.LoggerUtil;
import com.zhy.http.okhttp.OkHttpUtils;

import java.util.concurrent.TimeUnit;

import okhttp3.OkHttpClient;

public class MyApplication  extends Application {
    public static MyApplication application;

    public static synchronized MyApplication getInstance(){
         return application;
    }

    @Override
    public void onCreate(){
        super.onCreate();
        application=this;
        LoggerUtil.init(true);//初始化LoggerUtil
    }

    //持久化cookie 保存在SharedPreferences中
    private void setOkHttp() {
        OkHttpClient okHttpClient = new OkHttpClient.Builder()
                .connectTimeout(10000L, TimeUnit.MILLISECONDS)
                .readTimeout(30000L, TimeUnit.MILLISECONDS)
                .build();
        OkHttpUtils.initClient(okHttpClient);
    }
}
